CREATE TABLE dm_upload_in_time_count_dt (
 manage_code varchar(50) NULL COMMENT "管理大区code",
 agent_code varchar(50) NULL COMMENT "代理区code",
 network_code varchar(50) NULL COMMENT "责任网点code",
 source_name varchar(50) NULL COMMENT "订单来源名称",
 agent_name varchar(100) NULL COMMENT "代理区名称",
 fran_code varchar(50) NULL COMMENT "加盟商code",
 fran_name varchar(100) NULL COMMENT "加盟商名称",
 scan_date date NULL COMMENT "扫描日期",
 network_name varchar(100) NULL COMMENT "责任网点name",
 taking_num int(11) NULL COMMENT "揽收及时量",
 taking_no_num int(11) NULL COMMENT "揽收不及时量",
 transfer_num int(11) NULL COMMENT "转运及时量",
 transfer_no_num int(11) NULL COMMENT "转运不及时量",
 sign_num int(11) NULL COMMENT "签收及时量",
 sign_no_num int(11) NULL COMMENT "签收不及时量",
 deliver_num int(11) NULL COMMENT "派件及时量",
 deliver_no_num int(11) NULL COMMENT "派件不及时量",
 collect_num_proxy int(11) NULL COMMENT "代收上传及时量(代理点)",
 collect_no_num_proxy int(11) NULL COMMENT "代收不及时量(代理点)",
 collect_num int(11) NULL COMMENT "代收上传及时量(终端)",
 collect_no_num int(11) NULL COMMENT "代收不及时量(终端)",
 other_num int(11) NULL COMMENT "其他及时量",
 other_no_num int(11) NULL COMMENT "其他不及时量",
 all_cnt int(11) NULL COMMENT "整体上传及时量",
 all_no_cnt int(11) NULL COMMENT "整体不上传及时量",
 date_time date NULL COMMENT "查询日期",
 fine_sum decimal64(16, 2) NULL COMMENT "不及时量预罚款金额(单位元)",
 manage_name varchar(50) NULL COMMENT "管理大区名称"
) ENGINE=OLAP 
DUPLICATE KEY(manage_code, agent_code, network_code, source_name)
COMMENT "上传及时率汇总"
PARTITION BY RANGE(date_time)
(
   START ("2023-01-01") END ("2023-02-03") EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(fran_code) BUCKETS 2
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "2",
"in_memory" = "false",
"storage_format" = "V2"
);